package FunctionInterface;

public class Main {

    public static void main(String[] args){
        Converter<String,Integer> converter = (from -> Integer.valueOf(from));
        Integer convered = converter.Converter("123");
        System.out.println(convered);


        /***
         * Java 8 中允许你通过 :: 关键字来引用类的方法或构造器。上面的代码简单的示例了如何引用静态方法，当然，除了静态方法，我们还可以引用普通方法：
         */

        Something something = new Something();
        Converter<String,String> converter_1 = something::startWith;
        String converted = converter_1.Converter("java");
        System.out.println(converted);
    }
}
